{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "17574565-b2a1-4a25-96d0-6a2d2f56f684",
   "metadata": {},
   "source": [
    "## Summary\n",
    "\n",
    "The 2.4 Release contains many new changes that improve the performance and experience of using the Python API.  The Python API incorporates the Jupyter Lab 4.0 and Notebook 7.0 architecture to align with how these applications process Python code. The backend architecture changes necessitated a complete overhaul of fundamental structures within the Python API which required both the removal of some modules & classes and the transfer of functionality into new modules, classes, and accompanying properties/methods. \n",
    "\n",
    "These modifications change how some familiar functionality is accessed, and provides some new ways to work with your Web GIS organization. Let's take a look at some of these new updates."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea6769b7-0727-4afe-b5d0-c052726e4a46",
   "metadata": {},
   "source": [
    "Primary Python Support is for version 3.11.  Secondary support is provided for Python 3.10 and 3.12.  We have dropped Support for Python 3.9."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ff163308-2526-4b3a-965b-5b430738c5f8",
   "metadata": {},
   "source": [
    "> **Note:** The ArcGIS API for Python 2.4.0 release is supported with:\n",
    "* ArcGIS Pro 3.4 and later cloned environments\n",
    "* ArcGIS Enterprise 11.4 and later\n",
    "* Stand-alone _conda_ and Python environments"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3da4c48b-3c82-490f-9b76-d2063307b56c",
   "metadata": {},
   "source": [
    "## Refactor: `arcgis.mapping` module"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a3b59934-0694-41d2-8721-0a7bcdffa94b",
   "metadata": {},
   "source": [
    "The previous [`arcgis.mapping`](/python-2-3/api-reference/arcgis.mapping.toc.html) module functionality was documented in the following subsections in the Python API reference. The _mapping_ module has been refactored into two new modules, the [`map`](/python/latest/api-reference/arcgis.map.toc.html) and [`layers`](/python/latest/api-reference/arcgis.layers.toc.html) modules. Let's do a quick rundown of how those classes have been refactored."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "44159000-6f6b-473f-8243-8a2e809bc302",
   "metadata": {},
   "source": [
    "**Working with 2D Maps:**\n",
    "Classes for working with Web Map items and packaging offline map areas \n",
    "\n",
    "* The _WebMap_ class has been deprecated. The functionality for working with web maps has been refactored to the new [_Map_](/python/latest/api-reference/arcgis.map.toc.html#map) class in the [`arcgis.map`](/python/latest/api-reference/arcgis.map.toc.html) module. See [WebMap class](#the-webmap-class) in this document for more details.\n",
    "  * See [Using the map widget](../using-the-map-widget) and [Working with web maps and web scenes](../working-with-web-maps-and-web-scenes) _Working with web maps_ for examples.\n",
    "* The _OfflineMapAreaManager_ and _PackagingJob_ have been refactored into the _arcgis.map_ module.  The [_offline_areas_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Map.offline_areas) property of the new _Map_ class accesses the [OfflineMapAreaManager](/python/latest/api-reference/arcgis.map.toc.html#offlinemapareamanager) similarly to the same property on the previous _WebMap_.\n",
    "  * See [Managing offline map areas](../managing-offline-map-areas/) for example."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "10347e9f-b4b9-4dcf-855b-4cf2fc5f5426",
   "metadata": {},
   "source": [
    "**Working with 3D Maps:**\n",
    "Classes for working the Web Scenes and the data types displayed through scene layers\n",
    "\n",
    "* The _WebScene_ class has been deprecated and its functionality refactored into the [_Scene_ ](/python/latest/api-reference/arcgis.map.toc.html#scene) class in the `arcgis.map` module.\n",
    "  * See [Using the map widget](../using-the-map-widget)  _Displaying in 3d_ and [Working with web maps and web scenes](../working-with-web-maps-and-web-scenes) _Working with web scenes_ for examples.\n",
    "* All other classes in this section have been refactored into the [`arcgis.layers`](/python/latest/api-reference/arcgis.layers.toc.html) module and documented under the [_Working with 3D Maps_](/python/latest/api-reference/arcgis.layers.toc.html#working-with-3d-maps) section in the new module.  "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4682b163-320c-4aa5-8b5d-7021c82088e5",
   "metadata": {},
   "source": [
    "**Working with Map Service Layers:**\n",
    "Classes for working with Map Services and the associated layers within them\n",
    "\n",
    "The classes have been refactored into the `arcgis.layers` module documented under the [_Working with Map Service Layers_](/python/latest/api-reference/arcgis.layers.toc.html#working-with-map-service-layers) subsection."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c7a09e11-2731-4b32-a260-12dceed86505",
   "metadata": {},
   "source": [
    "**Working with OGC layers:**\n",
    "Classes for working with services compliant with [OGC standards](https://opengeospatial.github.io/e-learning/ogc-standards/text/services-ogc.html)\n",
    " \n",
    "The `arcgis.mapping.ogc` submodule classes have all been refactored into the `arcgis.layers` module documented in the [_Working with OGC layers_](/python/latest/api-reference/arcgis.layers.toc.html#working-with-ogc-layers) subsection."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cdd763f9-a5f1-4ec0-8c2e-602fe02bae3b",
   "metadata": {},
   "source": [
    "**Working with Map Forms:**\n",
    "Components to control behavior for data collecting and editing in applications like Map Viewer or ArcGIS Field Maps\n",
    "\n",
    "The functionality of the `arcgis.mapping.forms` submodule has been refactored into the `arcgis.map` module and accessed using the [_form()_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent.form) method of the [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class. Full reference documentation is provided in [_Forms_](/python/latest/api-reference/arcgis.map.toc.html#forms) reference documentation."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "94db7fbf-52b1-416d-a6bc-6228c3e218e9",
   "metadata": {},
   "source": [
    "**Utility Functions for Mapping:**\n",
    "Class and functions for working with symbology and rendering in the map widget.\n",
    "\n",
    "* The functionality of the _Symbology_ class has been refactored into the [`Symbols`](/python/latest/api-reference/arcgis.map.toc.html#symbols) module.\n",
    "* The functionality for generating renderers has been refactored into the [_SmartMappingManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.SmartMappingManager) and [_RendererManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.renderers.RendererManager) classes.\n",
    "  * See [Smart mapping](../smart-mapping), [Advanced cartography 1](../advanced-cartography-part1) and [Advanced cartography 2](../advanced-cartography-part2) for examples.\n",
    "* The functionality for exporting and printing has been refactored into the [print()](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Map.print) and [export_to_html()](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Map.export_to_html) methods of the _Map_ class."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "500a26a0-d8aa-498e-9ec3-0a4473994b9f",
   "metadata": {},
   "source": [
    "## The _WebMap_ class\n",
    "\n",
    "The _WebMap_ class has been deprecated and its functionality has been refactored into the [_Map_](/python/latest/api-reference/arcgis.map.toc.html#map) class in the new `arcgis.map` module. Initialize a new map object with an existing Web Map item by entering it as the *item* argument, similarly to initializing with the previous class."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8a31d940-b8bd-4bcb-b2cd-8ee9aeb4d964",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Initialize in 2.4.x and after\n",
    "from arcgis.map import Map\n",
    "\n",
    "wm_item = gis.content.get(\"<web_map_id>\")\n",
    "\n",
    "wm = Map(\n",
    "    item = wm_item\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cf93fbbc-d2b9-4770-bb3e-875d1b44db9f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Initialize in 2.3.x and prior\n",
    "from arcgis.mapping import WebMap\n",
    "wm = WebMap(\n",
    "    webmapitem = item\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6d0ad020-53e3-4710-80d5-d20beb724730",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "source": [
    "The table below shows a mapping between previous WebMap class properties and methods and corresponding functionality in the new 2.4 release:\n",
    "\n",
    "Methods:\n",
    "\n",
    "|WebMap operation                      |Map operation                        |Notes|\n",
    "|:-                                 |:-                                 |:-    |\n",
    "|wm.add_layer()|m.content.add()|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|wm.add_table()|m.content.add()|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|wm.basemap_title()|m.basemap.title|new [_BasemapManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) class property\n",
    "|wm.configure_pop_ups()|m.content.popup(index_position)|new [_PopupManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.popups.PopupManager) class\n",
    "|wm.get_layer()|m.content.layers[index_position]||new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|wm.get_table()|m.content.tables[index_position]||new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|wm.move_from_basemap()|m.basemap.move_from_basemap(layer_index)|new [_BasemapManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) class method\n",
    "|wm.move_to_basemap()|m.content.move_to_basemap(layer_index)|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|wm.print()|m.print()|\n",
    "|wm.remove_layer()|m.content.remove(index_position)|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|wm.remove_table()|m.content.remove(index_position, False)|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|wm.save()|m.save()|\n",
    "|wm.update()|m.update()|\n",
    "|wm.update_drawing_info()|m.content.update_layer(renderer)|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method (update [_Renderer_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.renderers.RendererManager.renderer) for layer)\n",
    "|wm.update_layer()|m.update_layer()|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "\n",
    "Properties\n",
    "\n",
    "|WebMap member                      |Map member                         |Notes|\n",
    "|:-                                 |:-                                 |:-    |\n",
    "|wm.basemap|m.basemap.basemap|new BasemapManager class|\n",
    "|wm.basemap_switcher|NA||\n",
    "|wm.basemaps|wm.basemap.basemap_gallery|List|\n",
    "|wm.basemaps|m.basemap.basemaps|property on new BasemapManager class\n",
    "|wm.bookmarks|m.bookmarks.list|list property on new Bookmarks class\n",
    "|wm.events|NA|\n",
    "|wm.forms|m.content.form()|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method (returns [_FormInfo_](/python/latest/api-reference/arcgis.map.toc.html#forminfo) for managing forms)\n",
    "|wm.gallery_basemaps|m.basemap.basemap_gallery|new [_BasemapManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) class property\n",
    "|wm.height|NA||\n",
    "|wm.layer_visibility|m.layer_visibility=True|new [_LayerVisibility_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.LayerVisibility) widget\n",
    "|wm.layers|m.content.layers|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class property\n",
    "|wm.legend|m.legend.enabled=True|new [Legend](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.Legend) widget\n",
    "|wm.navigation|NA|\n",
    "|wm.offline_areas|m.offline_areas|[OfflineMapAreaManager](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.OfflineMapAreaManager)\n",
    "|wm.pop_ups|m.content.popups(layer_index).disable_popup|new [_PopupManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.popups.PopupManager) property\n",
    "|wm.scale_bar|NA|\n",
    "|wm.search|NA|\n",
    "|wm.tables|m.content.tables|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class property\n",
    "|wm.view_bookmarks|m.bookmarks.list|new [_Bookmarks_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.Bookmarks) class property\n",
    "|wm.width|NA|\n",
    "|wm.zoom|m.zoom|"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ec299774-0441-4158-af5d-e6fb4831bf10",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "source": [
    "## The _arcgis.widgets_ module"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "595c5654-4f1c-42ee-ad9b-b3aa205c8826",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "source": [
    "The previous `arcgis.widgets` module contained the [MapView](/python-2-3/api-reference/arcgis.widgets.html#mapview) class which served as the map widget in Jupyter notebooks. The Python API 2.4 release refactors the _MapView_ functionality into two new classes in the [`arcgis.map`](/python/latest/api-reference/arcgis.map.toc.html) module: [_Map_](/python/latest/api-reference/arcgis.map.toc.html#map) and [_Scene_](/api-reference/arcgis.map.toc.html#scene) classes.\n",
    "\n",
    "In previous releases, maps and scenes were intialized based on the _mode_ argument entered in the [GIS.map()](/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.GIS.map) method, or by setting the [_mode_](/python-2-3/api-reference/arcgis.widgets.html#arcgis.widgets.MapView.mode) property of a _MapView_ object.  Either way, you were always working with an instance of the _MapView_ class. You can still use the _mode_ argument when intializing the _gis.map()_ object, but rather than returning the same type of object, the default value of _2D_ will return a _Map_ object, and _3D_ will return a _Scene_ object. Refactoring the calls allowed Python development to align with the [web map specification](https://developers.arcgis.com/web-map-specification/) and the [web scene specification](https://developers.arcgis.com/web-scene-specification/) directly. This will increase widget compatibility within notebooks to more closely reflect the browser experiences of the Map Viewer and Scene Viewer.\n",
    "\n",
    "Some properties and methods on the _MapView_ class have been entirely removed, including interactive functionality that could be programmed into specific events like _on_click_ and _on_draw_, embedding the widget into the notebook, and properties and methods that controlled the Jupyter environment. Other properties and methods have been refactored into new classes, many using the exact same name. See the table below for a mapping between previous _MapView_ method and property names and how to access that functionality within the 2.4 release.\n",
    "\n",
    "> _Note:_ In the table below, _mview_ represents a variable to a _MapView_ object, _m_ represents a variable to a _Map_ object, and _scene_ to a _Scene_ object.\n",
    "\n",
    "Methods:\n",
    "\n",
    "|MapView class operation                      |Map class operation                        |Notes|\n",
    "|:-                                 |:-                                 |:-    |\n",
    "|mview.add_layer()|m.content.add()|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|mview.clear_graphics()|m.content.remove_all()|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|mview.display_message()|NA|\n",
    "|mview.draw()|m.content.draw()|\n",
    "|mview.embed()|NA|\n",
    "|mview.export_to_html()|m.export_to_html()|\n",
    "|mview.hide_mode_swich()|NA|\n",
    "|mview.on_click()|NA|\n",
    "|mview.on_draw_end()|NA|\n",
    "|mview.remove_layers()|m.content.remove(index_position) *also m.content.remove_all()*|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class\n",
    "|mview.save()|m.save()|\n",
    "|mview.set_js_cdn|NA|\n",
    "|mview.set_time_extent()|m.time_slider.time_extent()|new [_TimeSlider_](/ypthon/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.TimeSlider) class method\n",
    "|mview.snap_to_zoom()|NA|\n",
    "|mview.sync_navigation()|m.sync_navigation()|\n",
    "|mview.take_screenshot()|NA|\n",
    "|mview.toggle_window_view()|NA|\n",
    "|mview.unsync_navigation()|m.unsync_navigation()|\n",
    "|mview.update()|m.update()|\n",
    "|mview.update_layer()|m.content.update_layer|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class method\n",
    "|mview.zoom_to_layer()|m.zoom_to_layer()\n",
    "\n",
    "Properties\n",
    "\n",
    "|MapView class member                      |Map class member                         |Notes|\n",
    "|:-                                 |:-                                 |:-    |\n",
    "|mview.basemap|m.basemap.basemap|new [_BasemapManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) class property\n",
    "|mview.basemaps|m.basemap.basemaps|new [_BasemapManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) class property\n",
    "|mview.center|m.center|\n",
    "|mview.draw|m.content.draw()|\n",
    "|mview.end_time|m.time_slider.time_extent()|new [_TimeSlider_](/ypthon/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.TimeSlider) class method\n",
    "|mview.extent|m.extent|\n",
    "|mview.gallery_basemaps|m.basemap.basemap_gallery|new [_BasemapManager_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) class property\n",
    "|mview.jupyter_target|NA|\n",
    "|mview.heading|scene.heading|new [_Scene_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Scene) class property\n",
    "|mview.layers|m.content.layers|new [_MapContent_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) class property\n",
    "|mview.legend|m.legend.enabled = True|new [Legend](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.Legend) widget\n",
    "|mview.local_raster_file_format|NA|\n",
    "|mview.mode|gis.map(mode=\"2D\" or \"3D\")|* a parameter when initializing [_Map_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Map) class\n",
    "|mview.print_service_url|NA|\n",
    "|mview.ready|NA|\n",
    "|mview.rotation|m.rotation|\n",
    "|mview.scale|m.scale|\n",
    "|mview.start_time|m.time_slider.time_extent()|new [_TimeSlider_](/python/latest/api-reference/arcgis.map.toc.html#id0) class method\n",
    "|mview.tab_mode|NA|\n",
    "|mview.tilt|scene.tilt|new [_Scene_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Scene) class property\n",
    "|mview.time_mode|m.time_slider.time_extent()|new [TimeSlider](/python/latest/api-reference/arcgis.map.toc.html#id8) class method\n",
    "|mview.time_slider|m.time_slider.enabled=True|new [TimeSlider](/python/latest/api-reference/arcgis.map.toc.html#id0) widget\n",
    "|mview.zoom|m.zoom|"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cf3137ae-d871-4e3b-8750-5f16a88502f8",
   "metadata": {},
   "source": [
    "## New `arcgis map` Module"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "71dfa756-839a-4816-833f-05942aa488d4",
   "metadata": {},
   "source": [
    "### The `Map` class\n",
    "\n",
    "The new [_map_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map) class was developed to align with the Jupyter Lab and Notebook 7 backend architecture and processing. The class includes properties which return auxiliary managment classes and interactive widget buttons for comprehensive management and visualization of a map and its content.\n",
    "\n",
    "* _bookmarks_ property - returns [Bookmarks](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.Bookmarks) object to manage individual [bookmarks](/python/latest/api-reference/arcgis.map.toc.html#bookmark) \n",
    "* _content_ property - returns [MapContent](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.MapContent) object to manage layers in a map\n",
    "  * _popup_ property - returns [PopupManager](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.popups.PopupManager) object to manage popup information for the layer entered as the _index_ argument\n",
    "    * See [Locating addresses](../part2-locating-addresses/) for examples.\n",
    "  * _renderer_ property - returns [RendererManager](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.renderers.RendererManager) object to manage symbology for layer entered as the _index_ argument\n",
    "    * See [Analyzing patterns in feature data](../analyzing-patterns-in-feature-data/) for example.\n",
    "  * _layer_visibility_ property - adds or removes a layer from the [layer list widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.LayerList) \n",
    "* _basemap_ property - returns [BasemapManager](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) object to manage the basemap for the map\n",
    "  * See [Using the map widget](../using-the-map-widget) _Basemaps_ section for example. \n",
    "\n",
    "New widgets to provide increased visibility of the content on a rendered map in a Jupyter notebook:\n",
    "* _legend_ - adds or removes a [legend widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.Legend)\n",
    "* _layer_list_ - adds or removes [layer list widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.LayerList)\n",
    "* _time_slider_ - adds or removes a [time slider widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.TimeSlider)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "05f7b7ef-b00f-4cc1-acf6-a96967562447",
   "metadata": {},
   "source": [
    "### The `Scene` Class\n",
    "The new [_scene_](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.Scene) class was developed to align with the Jupyter Lab and Notebook 7 backend architecture and processing. The class includes properties which return auxiliary managment classes and interactive widget buttons for comprehensive management and visualization of a scene and its content.\n",
    "\n",
    "* _content_ property - returns [SceneContent](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.scene_widget.SceneContent) object to manage the layers in a scene\n",
    "* _basemap_ property - returns [BasemapManager](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.BasemapManager) to manage the basemap for the scene\n",
    "\n",
    "New widgets to provide enhanced visualization on a rendered _Scene_ in a Jupyter notebook:\n",
    "* _environment.daylight_enabled_ - adds or removes a  [daylight widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.scene_widget.Environment.daylight_enabled)\n",
    "* _environment.weather_enabled_ - adds or removes a [weather widget](/python//api-reference/arcgis.map.toc.html#arcgis.map.scene_widget.Environment.weather_enabled)\n",
    "* _legend_ - adds or removes a [legend widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.Legend)\n",
    "* _layer_list_ - adds or removes [layer list widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.LayerList)\n",
    "* _time_slider_ - adds or removes [time slider widget](/python/latest/api-reference/arcgis.map.toc.html#arcgis.map.map_widget.TimeSlider)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "192b0363-0e55-4c7f-8e52-0ce5515464bd",
   "metadata": {},
   "source": [
    "## New `arcgis.layers` module"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3b551453-1bc1-4962-8f24-7566ecc8ffdf",
   "metadata": {},
   "source": [
    "### The `Service` class"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ab4f4d6d-118a-4741-86c1-88685fc8c83f",
   "metadata": {},
   "source": [
    "The module also adds a new [_Service_](/python/latest/api-reference/arcgis.layers.toc.html#service) class designed to simplify getting specific types of services into the appropriate API object.  No longer do you need to import a specific class into your scripts in order to initialize objects from url values to initialize the correct object. Now you can use the Service class to automatically determine the appropriate object type to return. Any service url entered as input will return an object of the corresponding class in the API. See below:\n",
    "\n",
    "Most of the classes from the previous `arcgis.mapping` module have been refactored into this module.  See the documentation above in the [arcgis.mapping](#refactor-arcgismapping-module) section for explanation.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "36410a72-7f27-4bef-a586-d3c6aca6924e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "arcgis.features.layer.FeatureLayerCollection"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Previous releases:\n",
    "from arcgis.features import FeatureLayerCollection\n",
    "from arcgis.gis import GIS\n",
    "\n",
    "gis = GIS(profile=\"your_online_profile\")\n",
    "\n",
    "fcoll = FeatureLayerCollection(\n",
    "    url = \"https://services5.arcgis.com/jmdi6ffhe45GMz1s/arcgis/rest/services/Groundwater_Ordinance_Areas/FeatureServer\", \n",
    "    gis=gis\n",
    ")\n",
    "\n",
    "type(fcoll)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "2d3741fe-3568-44e4-b52f-e7bbdb25707b",
   "metadata": {
    "editable": true,
    "slideshow": {
     "slide_type": ""
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'arcgis.features.layer.FeatureLayerCollection'>\n",
      "<class 'arcgis.layers._msl.map_layers.MapImageLayer'>\n",
      "<class 'arcgis.layers._scenelyrs._lyrs.Object3DLayer'>\n"
     ]
    }
   ],
   "source": [
    "# New at 2.4\n",
    "from arcgis.layers import Service\n",
    "\n",
    "fcoll = Service(\n",
    "    url_or_item=\"https://services5.arcgis.com/jmdi6ffhe45GMz1s/arcgis/rest/services/Groundwater_Ordinance_Areas/FeatureServer\",\n",
    "    server=gis\n",
    ")\n",
    "\n",
    "print(type(fcoll))\n",
    "\n",
    "service_obj = Service(\n",
    "    url_or_item=\"https://mapservices.weather.noaa.gov/vector/rest/services/outlooks/natl_fcst_wx_chart/MapServer\",\n",
    "    server=gis\n",
    ")\n",
    "\n",
    "print(type(service_obj))\n",
    "\n",
    "scene_obj = Service(\n",
    "    url_or_item=\"https://tiles.arcgis.com/tiles/oPre3pOfRfefL8y0/arcgis/rest/services/swissbuildings3D/SceneServer\"\n",
    ")\n",
    "\n",
    "print(type(scene_obj))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3c5be553-5744-490f-9c7b-7a2d1c4007e5",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
